// pages/collect/index.js
Page({
  data: {
    tabs: [
      {
        id: 0,
        value: '商品收藏',
        isActive: true
      },
      {
        id: 1,
        value: '品牌收藏',
        isActive: false
      },
      {
        id: 2,
        value: '店铺收藏',
        isActive: false
      },
      {
        id: 3,
        value: '浏览足迹',
        isActive: false
      }
    ],
    star: []
  },
  onShow() {
    const star = wx.getStorageSync('star') || []
    this.setData({
      star
    })   
  },
  handelTabsItemChange(e) {
    const { index } = e.detail
    let { tabs } = this.data
    tabs.forEach((v, i) => {
      v.isActive = i === index ? true : false
    })
    this.setData({
      tabs
    })
  }
})